/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"//uart_printf
#ifdef __GNUC__
  /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
     set to 'Yes') calls __io_putchar() */
  #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
  #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */

#include "stm32f4xx_flash_driver.h"
#include "lcd.h"
#include "w25qxx.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
//璋冭瘯瀹忓畾涔?
#define UARTDEBUG  1
#define JUST_JUMP  0

//SPI_FlashAddress
#define FLASH_STM32_CODE_START      (0x00960000)        //stm32鍥轰欢瀛樺偍锛歸25qxx鍦板潃0x00960000+480K
#define FLASH_PROGRAM_UPDATA_FLG    (0x009FF000)        //璇诲彇STM32鍥轰欢鐗堟湰鍦板潃浠嶴PIflash涓?
#define _W25QXX_USE_DMA 	      1

//STM32flashAddress
#define StartServerManageFlashAddress   FLASH_SECTOR_4_ADDR//璇诲啓璧峰鍦板潃锛堝唴閮╢lash鐨勪富瀛樺偍鍧楀潃鈥斺?斾粠FLASH_SECTOR_4_ADDR寮?濮?
#define ADDR_FLASH_VERSION      (ADDR_FLASH_SECTOR_22)//flash鍥轰欢鐗堟湰鍦拌捣
#include <stdio.h>
#include <string.h>
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define FLASH_CS_Pin GPIO_PIN_12
#define FLASH_CS_GPIO_Port GPIOB
#define LCD_BL_Pin GPIO_PIN_5
#define LCD_BL_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
